<!DOCTYPE html>
<html 
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"
	lang="en">
<head>
	<th:block th:include="layout/header :: header-meta('')"></th:block>
</head>
<body>

<th:block th:include="layout/header :: navbar"></th:block>

<div class="container">

<div th:if="${param.success ne null and param.success[0] eq 'true'}" class="alert alert-success">Saved!</div>

<form action="" method="post" th:object="${newsItem}" class="form-horizontal blogForm">
	<input type="hidden" th:field="*{id}" />
	<div class="form-group">
		<label for="title" class="col-sm-2 control-label">Title:</label>
		<div class="col-sm-10">
			<input type="text" th:field="*{title}" class="form-control" />
			<span th:if="${#fields.hasErrors('title')}" th:errors="*{title}">error</span>
		</div>
	</div>
	<div class="form-group" th:if="${newsItem.id != null}">
		<label for="shortName" class="col-sm-2 control-label">Short name:</label>
		<div class="col-sm-10">
			<input type="text" th:field="*{shortName}" class="form-control" />
			<span th:if="${#fields.hasErrors('shortName')}" th:errors="*{shortName}">error</span>
		</div>
	</div>
	<div class="form-group">
		<label for="shortDescription" class="col-sm-2 control-label">Short description:</label>
		<div class="col-sm-10">
			<input type="text" th:field="*{shortDescription}" class="form-control" />
			<span th:if="${#fields.hasErrors('shortDescription')}" th:errors="*{shortDescription}">error</span>
		</div>
	</div>
	<div class="form-group">
		<label for="description" class="col-sm-2 control-label">Description:</label>
		<div class="col-sm-10">
			<textarea rows="10" th:field="*{description}" class="form-control"></textarea>
			<span th:if="${#fields.hasErrors('description')}" th:errors="*{description}">error</span>
		</div>
	</div>

	<input type="submit" class="btn btn-primary" value="Save" />

</form>

<th:block th:include="layout/footer :: footer"></th:block>

</div>
</body>
</html>